FILE IO HANDLERS -- on readTextFile global file, FileIO set file = FileIO(mNew, "?read", "TEXT") if not objectp(file) then exit set the text of cast a21 to " " go to frame "Read" on readLine global file set s = file(mreadline) if s <> "" then set the text of cast a21 to s else alert "That is the last line of the file." & return & "Click Done to exit." end if on finishRead global file file(mDispose) set the text of cast a21 to " " go to frame "menu" on writeTextFile global file, FileIO set file = FileIO(mNew, "?write", "File I/O Write Test" ) if not objectp( file ) then set theProblem = string( file ) checkError exit end if set the text of cast a21 to " " go to frame "Write" when keyDown then stringEntry on appendTextFile global file, FileIO, theProblem set file = FileIO(mNew, "?append", "TEXT" ) if not objectp( file ) then set theProblem = string( file ) checkError exit end if set the text of cast a21 to " " go to frame "Write" when keyDown then stringEntry on checkError global theProblem if theProblem = -43 then exit -- the user clicked Cancel; no need to alert them else alert "FileIO object was not made." & return & return &¬ "Error: " & string( theProblem ) on stringEntry if the key = Return then dontPassEvent writeString end if on writeString global file set s to the text of cast a21 file( mWriteString, string( s ) & return ) set the text of cast a21 to " " set the selStart = 0 set the selEnd = 1000 on finishWrite global file file(mDispose) set the text of cast a21 to " " when keyDown then nothing go to frame "menu" on doAbout global file if objectp( file ) <> 0 then file(mdispose) set the text of cast a21 to " " go to frame "About" on doneFile global file if objectp( file ) <> 0 then file(mdispose) go to frame "xobj" of movie "•Main Menu"